package com.struts2.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.struts2.model.Product_line;
import com.struts2.service.ProductSearchService;


public class ProductNameSearchAction extends ActionSupport implements ModelDriven<List<Product_line>>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	
	private String input;
	private List<Product_line> product_line;

	//***********************************************

	public List<Product_line> getProduct_line() {
		return product_line;
	}


	public void setProduct_line(List<Product_line> product_line) {
		this.product_line = product_line;
	}

	public String getInput() {
		return input;
	}


	public void setInput(String input) {
		this.input = input;
	}
	/////////////////////////////////////////////////

	public String execute() {
 
		ProductSearchService productListService = new ProductSearchService();
		product_line = productListService.SearchProductList(product_line,input);
		
		
		return SUCCESS;
	}



	@Override
	public List<Product_line> getModel() {
		// TODO Auto-generated method stub
		return product_line;
	}
}

